﻿using System.Web.Mvc;
using System.Web;

namespace SampleSite.Views.Shared.Rescues
{
    public partial class Error : ViewPage<System.Exception>
    {
        protected override void OnInit(System.EventArgs e)
        {
            base.OnInit(e);
            if (this.ViewData is HttpException)
            {
                Response.StatusCode = ((HttpException)ViewData).GetHttpCode();
                Response.StatusDescription = ((HttpException)ViewData).Message;
            }
            else
            {
                Response.StatusCode = 500;
            }
        }
    }
}
